package cn.copera.dyy.entity;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import cn.copera.dyy.common.persistence.IdEntity;

/**
 * 店面活动图片
 * @author Administrator
 *
 */
@Entity
@Table(name = "ka_shop_image")
@DynamicInsert
@DynamicUpdate
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class ShopImage extends IdEntity<ShopImage>  {
	private static final long serialVersionUID = 1L;
	private Shop shop;
	private String fileName;
	private String type;
	private String flag;
	private String name;
	private String description;
	private String width,height;
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "shop_id")
	@NotFound(action = NotFoundAction.IGNORE)
	public Shop getShop() {
		return shop;
	}
	public void setShop(Shop shop) {
		this.shop = shop;
	}
	
	public String getWidth() {
		return width;
	}
	public void setWidth(String width) {
		this.width = width;
	}
	public String getHeight() {
		return height;
	}
	public void setHeight(String height) {
		this.height = height;
	}
	public String getName() {
		if(name==null){
			name="无";
		}
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	public String getDescription() {
		if(description==null||description.equals("")){
			return "无";
		}
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getFileName() {
		return fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getFlag() {
		return flag;
	}
	public void setFlag(String flag) {
		this.flag = flag;
	}
	
	

}
